(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

p(0) → 0
p(s(x)) → x
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
minus(x, 0) → x
minus(x, s(y)) → if(le(x, s(y)), 0, p(minus(x, p(s(y)))))
if(true, x, y) → x
if(false, x, y) → y

Rewrite Strategy: INNERMOST

(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted CpxTRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, 0) → z0
minus(z0, s(z1)) → if(le(z0, s(z1)), 0, p(minus(z0, p(s(z1)))))
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(z0, s(z1)) → c6(IF(le(z0, s(z1)), 0, p(minus(z0, p(s(z1))))), LE(z0, s(z1)), P(minus(z0, p(s(z1)))), MINUS(z0, p(s(z1))), P(s(z1)))
S tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(z0, s(z1)) → c6(IF(le(z0, s(z1)), 0, p(minus(z0, p(s(z1))))), LE(z0, s(z1)), P(minus(z0, p(s(z1)))), MINUS(z0, p(s(z1))), P(s(z1)))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS

Compound Symbols:

c4, c6

(3) CdtGraphRemoveTrailingProof (BOTH BOUNDS(ID, ID) transformation)

Removed 3 trailing tuple parts

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, 0) → z0
minus(z0, s(z1)) → if(le(z0, s(z1)), 0, p(minus(z0, p(s(z1)))))
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(z0, s(z1)) → c6(LE(z0, s(z1)), MINUS(z0, p(s(z1))))
S tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(z0, s(z1)) → c6(LE(z0, s(z1)), MINUS(z0, p(s(z1))))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS

Compound Symbols:

c4, c6

(5) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace MINUS(z0, s(z1)) → c6(LE(z0, s(z1)), MINUS(z0, p(s(z1)))) by

MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, 0) → z0
minus(z0, s(z1)) → if(le(z0, s(z1)), 0, p(minus(z0, p(s(z1)))))
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
S tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS

Compound Symbols:

c4, c6

(7) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
We considered the (Usable) Rules:none
And the Tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(LE(x1, x2)) = [3]   
POL(MINUS(x1, x2)) = x2   
POL(c4(x1)) = x1   
POL(c6(x1, x2)) = x1 + x2   
POL(s(x1)) = [4] + x1   

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, 0) → z0
minus(z0, s(z1)) → if(le(z0, s(z1)), 0, p(minus(z0, p(s(z1)))))
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
S tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
K tuples:

MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS

Compound Symbols:

c4, c6

(9) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

LE(s(z0), s(z1)) → c4(LE(z0, z1))
We considered the (Usable) Rules:none
And the Tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(LE(x1, x2)) = [2] + x2   
POL(MINUS(x1, x2)) = x2 + [2]x22 + [2]x1·x2   
POL(c4(x1)) = x1   
POL(c6(x1, x2)) = x1 + x2   
POL(s(x1)) = [1] + x1   

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, 0) → z0
minus(z0, s(z1)) → if(le(z0, s(z1)), 0, p(minus(z0, p(s(z1)))))
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:

LE(s(z0), s(z1)) → c4(LE(z0, z1))
MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
S tuples:none
K tuples:

MINUS(x0, s(z0)) → c6(LE(x0, s(z0)), MINUS(x0, z0))
LE(s(z0), s(z1)) → c4(LE(z0, z1))
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS

Compound Symbols:

c4, c6

(11) SIsEmptyProof (EQUIVALENT transformation)

The set S is empty

(12) BOUNDS(O(1), O(1))